#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void reseves(char* left, char* right)
{
	while (left < right)
	{
		char tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;
	}
}

int main()
{
	char arr[101] = { 0 };
	gets(arr);
	char* cur = arr;
	
	while (*cur)
	{
		char* end = cur;
		char* start = cur;
		while (*end != ' ' && *end != '\0')
		{
			end++;
		}
		reseves(start, end - 1);
		if (end != '\0')
		{
			cur = end + 1;
		}
		else {
			cur = end;
		}
	}
	
	int len = strlen(arr);
	reseves(arr, arr + len-1);
	/*for (int j = 0; j <= len; j++)
	{
		printf("%c", arr[j]);
	}*/
	printf("%s\n", arr);
	return 0;
}